package work1;

public class Producer extends Thread{
    private final Box box;
    public Producer(Box box) {
        this.box = box;
    }
    @Override
    public void run() {
        while(true){

            try {
                box.produce();
                Thread.sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
